package com.example.game.hff;

import java.awt.Graphics;
import java.awt.Image;

public class Item2 implements Constants {

	private Image image;
	private int x, y;
	private boolean active;
		
	
	public Item2(Image image) {
		this.image = image;
		x = SCREEN_WIDTH;
		y = 50 + ((int)(Math.random() * (700 - image.getHeight(null))));
		active = true;
	
	}
	
	public void draw(Graphics g) {
		g.drawImage(image, x, y, null);
	}
	public void update(){
		x -= 5;
		if (x < -256) {
			active = false;
		}
	}
	
	
	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
	public int getY() {
		return y;
	}
	public void setY(int y) {
		this.y = y;
	}
	
	public int getWidth() {
		return image.getWidth(null);
	}
	public int getHeight() {
		return image.getHeight(null);
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}
	
}
